package mc.dao;

import java.util.List;

import mc.domain.Alergen;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class AlergenManagerDAOHb extends HibernateDaoSupport implements IAlergenManagerDAO {

	public List getAllAlergeny() {
		return getHibernateTemplate().find("from Alergen");
		
	}

	public Alergen getAlergenById(int id) {
		return (Alergen) getHibernateTemplate().get(Alergen.class, new Integer(id));
	}

	public void saveAlergen(Alergen usluga) {
		getHibernateTemplate().saveOrUpdate(usluga);

	}

	public void deleteAlergen(Alergen usluga) {
		getHibernateTemplate().delete(usluga);
		
	}

	public void deleteAlergen(int id) {
		getHibernateTemplate().bulkUpdate("delete from Alergen where id=?", id);
		
	}

}
